from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get('https://www.baidu.com')
driver.maximize_window()
# driver name
print(driver.name)

# driver.current_url
print(driver.current_url)

# driver.page_source
print(driver.page_source)

# driver.current_window_handle
print(driver.current_window_handle)

# driver.window_handles
driver.find_element(By.LINK_TEXT,'新闻').click()
print(driver.window_handles)

# id--id标识
kw = driver.find_element(By.ID,'kw')
print(kw.id)

# size--宽高
print(kw.size)

# rect--宽高和坐标
print(kw.rect)

# tag_name--标签名
print(kw.tag_name)

# text--文本内容
print(kw.text)

news = driver.find_element(By.LINK_TEXT,'新闻')

# 退出浏览器
driver.quit()